package com.apes.fn.scm.retailOrder.model;

import com.apes.fn.business.fixedLoss.modle.LossQuotationPlan;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.framework.util.ApesConst;
import com.apes.scm.masterdata.frame.model.Dept;
import com.apes.scm.masterdata.party.model.PartyRole;
import com.apes.scm.masterdata.product.model.Classify;
import com.apes.scm.masterdata.product.model.Product;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * @ClassName : BudgetCut
 * @Description : 预算提成
 * @Author : ZZX
 * @Date: 2020年9月7日17:38:22
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = BudgetCut.CONST_TABLE_NAME)
public class BudgetCut extends Model {

    public final static String CONST_TABLE_NAME = "budget_cut";

    @Id
    @Column(name = "id", nullable = false, length = 24)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "预算提成明细", padding = 4)
    @Comment("ID")
    private String id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PRODUCT_ID", referencedColumnName = "id", nullable = false)
    @Comment("商品编码")
    private Product product;  //商品编码

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "COMPANY_ID", referencedColumnName = "id")
    private PartyRole company; //公司编码

    @Column(name = "CAR_NUMBER",length = 32)
    @Comment("车牌号码")
    private String carNumber;  //车牌号码

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "dept_id", referencedColumnName = "id", nullable = false)
    @Comment("部门编码")
    private Dept dept; //部门

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "classify_id", referencedColumnName = "id")
    @Comment("商品分类编码")
    private Classify classify;  //商品分类

    @Column(name = "SALE_AMT", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("销售金额")
    private double SALE_AMT = 0.0;  //销售金额

    @Column(name = "sale_qty", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("销售数量")
    private double saleQty = 0; //销售数量

    @Column(name = "cost_amount", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("成本金额")
    private double costAmount = 0.0;  //成本金额

    @Column(name = "TCJE", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("提成金额")
    private double TCJE = 0.0; //提成金额

    @Column(name = "sys_break", nullable = false, length = 32)
    @Comment("sys_break")
    private String sys_break;  //sys_break

    @Column(name = "conditionStrategy_id", nullable = false, length = 32)
    @Comment("执行过程id")
    private String conditionStrategyId;  //执行过程id

    @Column(name = "T401", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("低于锁价无提成(1:是,0:否)")
    private double T401 = 0.0;  //低于锁价无提成(1:是,0:否)(1:是,0:否)

    @Column(name = "NKDK_AMT", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("年卡抵扣金额")
    private double NKDK_AMT = 0.0;  //年卡抵扣金额

    @Column(name = "FXDK_AMT", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("返现金额")
    private double FXDK_AMT = 0.0;  //返现金额

    @Column(name = "END_DATE")
    @Comment("END_DATE")
    private String END_DATE; //END_DATE

    @Column(name = "SERVE_TYPE_ID")
    @Comment("服务类型id")
    private String SERVE_TYPE_ID; //服务类型id

    @Column(name = "BRAND_ID", nullable = false, length = 32)
    @Comment("品牌")
    private String BRAND_ID;  //品牌

    @Column(name = "YXSDJ", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("原销售单价")
    private double YXSDJ = 0.0;  //原销售单价

    @Column(name = "T013", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("XSTC3提成比率")
    private double T013 = 0.0;  //XSTC3提成比率

    @Column(name = "T014", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("XSTC4提成比率")
    private double T014 = 0.0;  //XSTC4提成比率

    @Column(name = "T011", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("XSTC1提成比率")
    private double T011 = 0.0;  //XSTC1提成比率

    @Column(name = "T012", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("XSTC2提成比率")
    private double T012 = 0.0;  //XSTC2提成比率

    @Column(name = "ORDER_TYPE", nullable = false, length = 32)
    @Comment("来源类型")
    private String ORDER_TYPE;  //来源类型

    @Column(name = "HBDK_AMT", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("红包抵扣金额")
    private double HBDK_AMT = 0.0;  //红包抵扣金额

    @Column(name = "LOCK_PRICE", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("锁价")
    private double LOCK_PRICE = 0.0;  //锁价

    @Column(name = "ASSESSMENT_COST_PRICE", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("考核成本价")
    private double ASSESSMENT_COST_PRICE = 0.0;  //考核成本价

    @Column(name = "T002", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("销售提成金额")
    private double T002 = 0.0;  //销售提成金额

    @Column(name = "T024", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("XSTC4大于等于折扣率")
    private double T024 = 0.0;  //XSTC4大于等于折扣率

    @Column(name = "DISCOUNT_AMOUNT", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("折扣金额")
    private double DISCOUNT_AMOUNT = 0.0;  //折扣金额

    @Column(name = "T201", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("考核成本价")
    private double T201 = 0.0;  //考核成本价

    @Column(name = "T022", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("XSTC2大于等于折扣率")
    private double T022 = 0.0;  //XSTC2大于等于折扣率

    @Column(name = "T001", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("销售提成比率")
    private double T001 = 0.0;  //销售提成比率

    @Column(name = "T023", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("XSTC3大于等于折扣率")
    private double T023 = 0.0;  //XSTC3大于等于折扣率

    @Column(name = "T021", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("XSTC1大于等于折扣率")
    private double T021 = 0.0;  //XSTC1大于等于折扣率

    @Column(name = "OPERATION", nullable = false, length = 32)
    @Comment("运营模式")
    private String OPERATION;  //运营模式

    @Column(name = "SOURCE_BUSINESS_TYPE_NAME", nullable = false, length = 32)
    @Comment("来源类型名称")
    private String SOURCE_BUSINESS_TYPE_NAME;  //来源类型名称

    @Column(name = "SYS_RQ")
    @Comment("预算日期")
    private Date sysRQ; //预算日期
}
